package operands;

import instructions.Instruction;
import core.Memory;


public abstract class Operand 
{
	Memory memory;
	Instruction instruction;
	int value;
	
	public Operand(int value)
	{	
		this.value = value;
	}
	
	public final void setInstruction(Instruction instruction)
	{
		this.instruction = instruction;
		this.memory = instruction.getMemory();
	}
	
	public void pre()
	{
		
	}
	
	public void post()
	{
		
	}
	
	public int resolve()
	{
		return value;
	}

	public abstract Operand copy();
	/**
	 * Gives the instruction this operand points to.
	 * @return
	 */
	public  abstract Instruction resolveInstruction();
}
